package com.zgl.airoleplay.controller;

import com.zgl.airoleplay.entity.Role;
import com.zgl.airoleplay.service.RoleService;
import com.zgl.airoleplay.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;
    @RequestMapping("/getAllRoles")
    public Result getAllRoles() {
        return roleService.getAllRoles();
    }
    @RequestMapping("/getRoleByName")
    public Result getRoleByName(String roleName) {
        System.out.println("roleName = " + roleName);
        return roleService.getRoleByName(roleName);
    }
}
